package com.liqw.auto.bean;

import com.liqw.Constant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

// ======================== Bean后处理器 ========================
@Slf4j
@Component
public class CustomBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) {
        System.out.println(Constant.getStepStr("CustomBeanPostProcessor.postProcessBeforeInitialization") + "CustomBeanPostProcessor - beforeInit : " + beanName);
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) {
        System.out.println(Constant.getStepStr("CustomBeanPostProcessor.postProcessAfterInitialization") + "CustomBeanPostProcessor - afterInit : " + beanName);
        return bean;
    }
}